### 2. Instrument your application
**For Kubernetes deployments with zero-code instrumentation:**

```yaml
apiVersion: openlit.io/v1alpha1
kind: AutoInstrumentation
metadata:
  name: otelcol-instrumentation
  namespace: default
spec:
  selector:
    matchLabels:
      instrument: "true"
  python:
    instrumentation:
      provider: "openlit"
      version: "latest"
  otlp:
    endpoint: "YOUR_COLLECTOR_ENDPOINT"
    timeout: 30
  resource:
    environment: "production"
    serviceName: "my-ai-service"
```

Replace:
1. `YOUR_COLLECTOR_ENDPOINT` with your OpenTelemetry Collector endpoint from Step 1.
   * **Kubernetes cluster**: `http://my-otel-collector:4318`
   * **External**: `http://your-collector-host:4318`

<Note>
When deploying the OpenTelemetry Collector in the same Kubernetes cluster, use the service name and namespace for the endpoint (e.g., `http://my-otel-collector.monitoring.svc.cluster.local:4318`).
</Note>

Refer to the [OpenLIT Operator Documentation](/latest/operator/overview) for more advanced configurations and use cases.
